package com.jay.media.music.ui.play

import android.media.MediaMetadata
import android.media.session.PlaybackState
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * @author xuzhou4
 * @date 2022/2/22
 */
class PlayViewModel : ViewModel() {
    private val playMusic: MutableLiveData<MediaMetadata> = MutableLiveData()
    private val playState: MutableLiveData<PlaybackState> = MutableLiveData()

    fun setPlayMusic(t: MediaMetadata?) {
        playMusic.postValue(t)
    }

    fun setPlayState(playbackState: PlaybackState?) {
        playState.postValue(playbackState)
    }

    fun getPlayMusic(): LiveData<MediaMetadata> {
        return playMusic
    }

    fun getPlayState(): LiveData<PlaybackState> {
        return playState
    }
}